<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Models\User;
use Faker\Generator as Faker;

$factory->define(User::class, function (Faker $faker) {
    return [
        'username'=>$faker->userName,
        'truename'=>$faker->name(),
        //PHP>=5.5开始提供的一种加密方式,
        //password_hash(),最大长度255,同一明文,每次加密的结果不一样
        //password_verify 验证
        'password'=>bcrypt('admin888'),
        'email'=>$faker->email,
        'phone'=>$faker->phoneNumber,
        'sex'=>['先生','女士'][rand(0,1)],
        'last_ip'=>$faker->ipv4
    ];
});
